#ifndef __DEEP_ZOOM_IMAGE_REGION_H__
#define __DEEP_ZOOM_IMAGE_REGION_H__

#include "cairo/cairo.h"
#include "rect.h"

namespace DeepZoomImage
{
	class Region
	{
		cairo_region_t *cairo_region;
		cairo_status_t status;

	public:
		Region ();
		Region (Rect rect);
		Region (cairo_region_t *cairo_region);
		Region (Region *region);
		Region (double x, double y, double width, double height);

		~Region ();

		bool IsEmpty ();

		void Union (Rect rect);
		void Union (Region *region);

		void Intersect (Region *region);
		void Intersect (Rect rect);

		void Subtract (Region *region);
		void Subtract (Rect rect);

		int GetRectangleCount ();
		Rect GetRectangle (int index);

		void Offset (int dx, int dy);

		Rect GetExtents ();
		cairo_region_overlap_t RectIn (Rect rect);

		void Draw (cairo_t *cr);
	};
}
#endif /* __DEEP_ZOOM_IMAGE_REGION_H__ */
